/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.dmtrsokolov.viewbean;

import java.io.Serializable;

/**
 *
 * @author Dmitry
 */
public class PurchaseItem implements Serializable {
    
    private Long id;
    private Integer number;
    private String name;
    private Double price;
    private Integer count;
    private Double sum;

    public PurchaseItem() {
    }

    public PurchaseItem(Long id, Integer number, String name, Double price, Integer count, Double sum) {
        this.id = id;
        this.number = number;
        this.name = name;
        this.price = price;
        this.count = count;
        this.sum = sum;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Double getSum() {
        return sum;
    }

    public void setSum(Double sum) {
        this.sum = sum;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final PurchaseItem other = (PurchaseItem) obj;
        if (this.number != other.number && (this.number == null || !this.number.equals(other.number))) {
            return false;
        }
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
            return false;
        }
        if (this.price != other.price && (this.price == null || !this.price.equals(other.price))) {
            return false;
        }
        if (this.count != other.count && (this.count == null || !this.count.equals(other.count))) {
            return false;
        }
        if (this.sum != other.sum && (this.sum == null || !this.sum.equals(other.sum))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 79 * hash + (this.number != null ? this.number.hashCode() : 0);
        hash = 79 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 79 * hash + (this.price != null ? this.price.hashCode() : 0);
        hash = 79 * hash + (this.count != null ? this.count.hashCode() : 0);
        hash = 79 * hash + (this.sum != null ? this.sum.hashCode() : 0);
        return hash;
    }
    
    
    
    
    
}
